import socket

# 创建一个socket对象
sk = socket.socket()

# 绑定ip和端口
sk.bind(('127.0.0.1', 8848))

# 监听
sk.listen()

# 等待连接
while True:
    conn, addr = sk.accept()

    data = conn.recv(1024)
    print(data)

    conn.send(b'HTTP/1.1 200 OK\r\n\r\nok')

    conn.close()
